import React, { Component } from 'react';
import { TextInput, StatusBar, View, Image, Text, TouchableOpacity } from 'react-native';
import { unitWidth, unitHeight, height, width } from '../constants/AdapterUtil';
import { CodeInput, IconInput, MyInput1, CodeInput2 } from '../components/Input';
import { SubmitButton1 } from '../components/Button';
import TextUtil from '../constants/TextUtil';
import { MyHeader } from '../components/MyHeader';
import { postFetch } from '../constants/HttpExtension';
import { show } from '../constants/Toast';
import { api_account_forget, api_member_info_updatePassword, api_member_info_opinion, api_member_info_Aboutus } from '../constants/HttpServices';
import Colors from '../constants/Colors';

export default class AboutScreen extends Component {

    constructor(props) {
        super(props)
        this.state = {
            about: {},
        }
    }

    componentDidMount() {
        this.getData();
    }

    render() {
        return (
            <View style={{ flex: 1, alignItems: 'center', backgroundColor: Colors.colorF5 }}>
                <MyHeader leftImg={require('../res/ic_arrow_left.png')} leftClick={() => { this.props.navigation.pop() }} title='关于我们' />
                <Image style={{ width: 80 * unitWidth, height: 80 * unitWidth, borderRadius: 40 * unitWidth, marginTop: 75 * unitWidth }}
                    source={{ uri: this.state.about.logo }} resizeMode='cover' />
                <Text style={{ fontSize: 20, color: Colors.black, marginTop: 30 * unitWidth }}>{this.state.about.name}</Text>
                <View style={{
                    width: 335 * unitWidth, minHeight: 257 * unitWidth, marginTop: 27 * unitWidth,
                    backgroundColor: Colors.colorOrange, borderRadius: 10, paddingVertical: 5 * unitWidth, paddingHorizontal: 10 * unitWidth
                }}>
                    <Text style={{ color: Colors.white, fontSize: 17 }}>{this.state.about.description}</Text>
                </View>
            </View>
        )
    }

    getData() {
        let params = {

        }
        postFetch(api_member_info_Aboutus, params, {
            success: (response) => {
                this.setState({
                    about: response.result
                })
            },
            fail: (response) => {
                show(response.result.message);
            }
        })
    }
}